

#include <QDebug>

// my
#include "MyForm.h"
#include "MyLoadDialogCmd.h"

//------------------------------------------------
MyLoadDialogCmd::MyLoadDialogCmd(QObject* parent)
    : QObject(parent)
    , m_pMyForm(nullptr) {
    connect(this, SIGNAL(onRectSizeChange(int, int, int, int)), this,
            SLOT(afterRectSizeChange(int, int, int, int)));
}
//------------------------------------------------
MyLoadDialogCmd::~MyLoadDialogCmd() {
}
//------------------------------------------------
QWidget* MyLoadDialogCmd::initialDialog() {
    if (nullptr == m_pMyForm) {
        m_pMyForm = new MyForm();
    }

    if (m_pMyForm) {
        m_pMyForm->setGeometry(10, 90, 300, 300);
        m_pMyForm->setStyleSheet("background-color: lightgray; color: naviy;");
    }
    return m_pMyForm;
}
//------------------------------------------------
void MyLoadDialogCmd::afterRectSizeChange(int x, int y, int w, int h) {
    qDebug() << "(x,y, w,h):" << x << y << w << h;
    m_pMyForm->setGeometry(x + 5, y + 20, w, h);
}
